package br.ucb.cm.config.dao;

public class DAOException extends Exception {
	private static final long serialVersionUID = 1L;
	private Throwable exception;
	
	public DAOException(Throwable exception) {
		this.exception = exception;
	}
	
	public DAOException(String message) {
		super(message);
	}

	public Throwable getException() {
		return exception;
	}
	public void setException(Throwable exception) {
		this.exception = exception;
	}
	
	@Override
	public String getMessage() {
		if(getException() != null)
			return getException().getMessage();
		return super.getMessage();
	}
}
